package com.yuki.fwwb.Controller;

import com.yuki.fwwb.Service.UsersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Api(value = "用户数据")
@RestController
@CrossOrigin(origins = "http://localhost:9000", maxAge = 3600)
public class UsersController {
    @Autowired
    UsersService usersService;
    @ApiOperation("查询用户年龄段结构")
    @PostMapping("/findAgeStructure")
    public List<Map> findAgeStructure(){
        return usersService.findAgeStructure();
    };
}
